q.each(function() {
    c.push({src: $(this).attr("href"), valign: $(this).data("valign"), align: $(this).data("align"), fade: 2000})
});
$.vegas(c[0])("overlay", {opacity: 0.5})("pause");
q.click(function() {
    if ($(this).is("#slideshow")) {
        if (x == false) {
            x = true;
            j.attr("src", "images/pause.png");
            j.attr("title", "Zatrzymaj pokaz slajdów");
            $.vegas("slideshow", {delay: 5000, backgrounds: c})
        } else {
            x = false;
            j.attr("src", "images/play.png");
            j.attr("title", "Uruchom pokaz slajdów");
            $.vegas("pause")
        }
    } else {
        x = false;
        j.attr("src", "images/play.png");
        j.attr("title", "Uruchom pokaz slajdów");
        var A = $(this).parent("li").index();
        $.vegas("stop")(c[A])
    }
    return false
});
$("body").bind("vegasload", function(B, A) {
    var C = $(A).attr("src").replace("background", "thumbnail");
    i.css("border", "1px solid #3b3b3b");
    $('img[src="' + C + '"]').css("border", "1px solid #f30b27")
});
var s = $("#thumbs a:first img")[0];
i.click(function() {
    s = this
});
i.mouseover(function() {
    $(this).css("border", "1px solid #f30b27")
});
i.mouseout(function() {
    if (this != s) {
        $(this).css("border", "1px solid #3b3b3b")
    }
});
$("#gallery").galleria({width: 700, height: 390, _toggleInfo: true, transition: "fade", transitionSpeed: 700, popupLinks: true, imageCrop: true});
a.animate({opacity: 0}, 0);
d.animate({opacity: 0}, 0);
t.animate({opacity: 0}, 0);
f.animate({opacity: 0}, 0);
w.animate({opacity: 0}, 0);
v.animate({opacity: 0}, 0);
y.animate({opacity: 0}, 0);
m.animate({opacity: 0}, 0);
a.delay(1500).animate({opacity: 1}, 1000, "easeOutQuart");
d.show().delay(2800).animate({opacity: 1, bottom: "158px"}, 1000, "easeOutQuart");
$("#close_bt").click(function() {
    d.animate({opacity: 0, bottom: "200px", height: "toggle"}, 1000, "easeOutQuart")
});